package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WmsInventoryCheckMapper;
import com.ruoyi.system.domain.WmsInventoryCheck;
import com.ruoyi.system.service.IWmsInventoryCheckService;
import com.ruoyi.common.core.text.Convert;

/**
 * 库存盘点记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-18
 */
@Service
public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService 
{
    @Autowired
    private WmsInventoryCheckMapper wmsInventoryCheckMapper;

    /**
     * 查询库存盘点记录
     * 
     * @param checkId 库存盘点记录主键
     * @return 库存盘点记录
     */
    @Override
    public WmsInventoryCheck selectWmsInventoryCheckByCheckId(Long checkId)
    {
        return wmsInventoryCheckMapper.selectWmsInventoryCheckByCheckId(checkId);
    }

    /**
     * 查询库存盘点记录列表
     * 
     * @param wmsInventoryCheck 库存盘点记录
     * @return 库存盘点记录
     */
    @Override
    public List<WmsInventoryCheck> selectWmsInventoryCheckList(WmsInventoryCheck wmsInventoryCheck)
    {
        return wmsInventoryCheckMapper.selectWmsInventoryCheckList(wmsInventoryCheck);
    }

    /**
     * 新增库存盘点记录
     * 
     * @param wmsInventoryCheck 库存盘点记录
     * @return 结果
     */
    @Override
    public int insertWmsInventoryCheck(WmsInventoryCheck wmsInventoryCheck)
    {
        wmsInventoryCheck.setCreateTime(DateUtils.getNowDate());
        return wmsInventoryCheckMapper.insertWmsInventoryCheck(wmsInventoryCheck);
    }

    /**
     * 修改库存盘点记录
     * 
     * @param wmsInventoryCheck 库存盘点记录
     * @return 结果
     */
    @Override
    public int updateWmsInventoryCheck(WmsInventoryCheck wmsInventoryCheck)
    {
        wmsInventoryCheck.setUpdateTime(DateUtils.getNowDate());
        return wmsInventoryCheckMapper.updateWmsInventoryCheck(wmsInventoryCheck);
    }

    /**
     * 批量删除库存盘点记录
     * 
     * @param checkIds 需要删除的库存盘点记录主键
     * @return 结果
     */
    @Override
    public int deleteWmsInventoryCheckByCheckIds(String checkIds)
    {
        return wmsInventoryCheckMapper.deleteWmsInventoryCheckByCheckIds(Convert.toStrArray(checkIds));
    }

    /**
     * 删除库存盘点记录信息
     * 
     * @param checkId 库存盘点记录主键
     * @return 结果
     */
    @Override
    public int deleteWmsInventoryCheckByCheckId(Long checkId)
    {
        return wmsInventoryCheckMapper.deleteWmsInventoryCheckByCheckId(checkId);
    }
}
